package com.newcapec.lesson7;

public class Person {

    private int age;
    private String name;
    private String sex;
    private String birthday;

    public void eat(){
        System.out.println("啥都吃");
    }

    public void eat(String foodName){
        System.out.println("I want eat "+foodName);
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }



    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if(age >= 150 || age <0){
            System.out.println("年龄设置有误，请重新设置");
            return;
        }
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }



    void drink(){
        System.out.println("drink water");
    }
}
